Expand description
QUIC transport protocol implementation
QUIC is a modern transport protocol addressing shortcomings of TCP, such as head-of-line blocking, poor security, slow handshakes, and inefficient congestion control. This crate provides a portable userspace implementation. It builds on top of quinn-proto, which implements protocol logic independent of any particular runtime.
The entry point of this crate is the Endpoint
.
About QUIC
A QUIC connection is an association between two endpoints. The endpoint which initiates the connection is termed the client, and the endpoint which accepts it is termed the server. A single endpoint may function as both client and server for different connections, for example in a peer-to-peer application. To communicate application data, each endpoint may open streams up to a limit dictated by its peer. Typically, that limit is increased as old streams are finished.
Streams may be unidirectional or bidirectional, and are cheap to create and disposable. For example, a traditionally datagram-oriented application could use a new stream for every message it wants to send, no longer needing to worry about MTUs. Bidirectional streams behave much like a traditional TCP connection, and are useful for sending messages that have an immediate response, such as an HTTP request. Stream data is delivered reliably, and there is no ordering enforced between data on different streams.
By avoiding head-of-line blocking and providing unified congestion control across all streams of a connection, QUIC is able to provide higher throughput and lower latency than one or multiple TCP connections between the same two hosts, while providing more useful behavior than raw UDP sockets.
Quinn also exposes unreliable datagrams, which are a low-level primitive preferred when automatic fragmentation and retransmission of certain data is not desired.
QUIC uses encryption and identity verification built directly on TLS 1.3. Just as with a TLS server, it is useful for a QUIC server to be identified by a certificate signed by a trusted authority. If this is infeasible–for example, if servers are short-lived or not associated with a domain name–then as with TLS, self-signed certificates can be used to provide encryption alone.
Re-exports
pub use udp;
Modules
- Logic for controlling the rate at which data is sent
- Traits and implementations for the QUIC cryptography protocol
Structs
- Future produced by
Endpoint::accept
- Future produced by
Connection::accept_bi
- Future produced by
Connection::accept_uni
- Reason given by an application for closing the connection
- A Quinn runtime for async-std
- A chunk of data from the receive stream
- Configuration for outgoing connections
- In-progress connection attempt future
- A QUIC connection.
- Reason given by the transport for closing the connection
- A QUIC endpoint.
- Global configuration for the endpoint, affecting all connections
- Maximum duration of inactivity to accept before timing out the connection.
- Parameters governing MTU discovery.
- Future produced by
Connection::open_bi
- Future produced by
Connection::open_uni
- Future produced by
Connection::read_datagram
- A stream that can only be used to receive data
- A stream that can only be used to send data
- Parameters governing incoming connections
- Identifier for a stream within a particular connection
- A Quinn runtime for Tokio
- An outgoing packet
- Parameters governing the core QUIC state machine
- Error indicating that a stream has already been finished or reset
- An integer less than 2^62
- Future that completes when a connection is fully established
Enums
- Errors in the configuration of an endpoint
- Errors in the parameters being used to create a new connection
- Reasons why a connection might be lost
- Errors that arise from reading from a stream.
- Errors that arise from reading from a stream.
- Errors from
RecvStream::read_to_end
- Errors that can arise when sending a datagram
- Errors that arise while monitoring for a send stream stop from the peer
- Errors that arise from writing to a stream
Traits
- Abstract implementation of an async timer for runtime independence
- Abstract implementation of a UDP socket for runtime independence
- Abstracts I/O and timer operations for runtime independence
Functions
- Automatically select an appropriate runtime from those enabled at compile time